import { FileSystemIconLoader } from 'unplugin-icons/loaders'
import Icons from 'unplugin-icons/vite'

export function ConfigSvgIconsPlugin() {
  return Icons({
    autoInstall: true,
    compiler: 'vue3',
    customCollections: {
      local: FileSystemIconLoader('src/assets/icons', (svg) => {
        return svg.replace(/^<svg /, '<svg fill="currentColor" ')
      })
    }
  })
}
